package com.my.chapter7;

public class practice14 {
    public static void main(String[] args) {
        Car.main(args);
    }
}

class Engine{
    public void start(){
        System.out.println("Engine start");
    }
    public void rev(){
        System.out.println("Engine rev");
    }
    public void stop(){
        System.out.println("Engine stop");
    }
    public void service(){
        System.out.println("Engine service");
    }
}

class Wheel{
    public void inflate(int psi){
        System.out.println("Wheel inflate"+psi);
    }
}

class Window{
    public void rollup(){
        System.out.println("Window rollup");
    }
    public void rolldown(){
        System.out.println("Window rolldown");
    }
}

class Door{
    public Window window = new Window();
    public void open(){
        System.out.println("Door open");
    }
    public void close(){
        System.out.println("Door close");
    }
}

class Car{
    public Engine engine = new Engine();
    public Wheel[] wheel = new Wheel[4];
    public Door
        left =new Door(),
        right=new Door();
    public Car(){
        for(int i=0;i<4;i++){
            wheel[i] = new Wheel();
        }
    }

    public static void main(String[] args) {
        Car car = new Car();
        car.left.window.rollup();
        car.wheel[0].inflate(72);
        car.engine.service();
    }
}
